<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Jialeo\LaravelSchemaExtend\Schema;

class CreateWorkOrderTypeTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('workflow_v2_type', function (Blueprint $table) {
            $table->id();
            $table->string('name', 36)->default('')->comment('名称');
            $table->string('type', 36)->default('')->comment('分类');
            $table->string('prefix', 8)->default('')->comment('生成工单号前缀名称');
            $table->string('description', 255)->default('')->comment('分类描述');
            $table->string('icon', 160)->default('')->comment('icon');
            $table->unsignedInteger('sort')->default(0)->comment('排序');
            $table->unsignedTinyInteger('status')->default(0)->comment('状态');
            $table->unsignedInteger('createdAt')->default(0)->comment('创建时间');
            $table->unsignedInteger('createdByUid')->default(0)->comment('创建人');
            $table->unsignedInteger('updatedAt')->default(0)->comment('修改时间');
            $table->unsignedInteger('updatedByUid')->default(0)->comment('修改人');
            $table->unsignedInteger('isDeleted')->default(0)->comment('是否删除');
            $table->collation = 'utf8mb4_general_ci';
            $table->comment = '工单分类';
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('workflow_v2_type');
    }
}
